(define (upper-bound interval)
  (let ((a (car interval))
        (b (cdr interval))))
  (if (< a b) b a))

(define (lower-bound interval)
  (let ((a (car interval))
        (b (cdr interval))))
  (if (> a b) b a))
